package com.salon.client;

import java.util.Date;
import java.util.List;
import java.util.Map;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.salon.client.beans.ClientBean;
import com.salon.client.beans.IncomeBean;
import com.salon.client.beans.IncomeMaterialsBean;
import com.salon.client.beans.MasterBean;
import com.salon.client.beans.MaterialBean;
import com.salon.client.beans.ParentPagingLoadResult;
import com.salon.client.beans.PriceBean;
import com.salon.client.beans.ProcedureBean;
import com.salon.client.beans.WhereBean;
import com.salon.client.beans.WorkDayBean;

/**
 * The async counterpart of <code>GreetingService</code>.
 */
public interface GreetingServiceAsync {
	public void login(String user, String passwd, AsyncCallback<Void> callback);

	public void logout(AsyncCallback<Void> callback);

	public void register(String username, String password, String name,
			AsyncCallback<Void> callback);
	
	public void getClients(int offset, int limit, List<WhereBean> wheres, AsyncCallback<ParentPagingLoadResult<ClientBean>> callback);
	
	public void addClient(ClientBean bean, AsyncCallback<Void> callback);
	
	public void getMasters(int offset, int limit, List<WhereBean> wheres, AsyncCallback<ParentPagingLoadResult<MasterBean>> callback);
	
	public void addMaster(MasterBean bean, AsyncCallback<Void> callback);
	
	public void getMaterials(int offset, int limit, List<WhereBean> wheres, AsyncCallback<ParentPagingLoadResult<MaterialBean>> callback);
	
	public void addMaterial(MaterialBean bean, AsyncCallback<Void> callback);
	
	public void deleteItem(String table, int id, AsyncCallback<Void> callback);
	
	public void getIncomes(int offset, int limit, AsyncCallback<ParentPagingLoadResult<IncomeBean>> callback);
	
	public void addIncomeMaterial(IncomeMaterialsBean bean, AsyncCallback<IncomeMaterialsBean> callback);
	
	public void addIncome(IncomeBean bean, AsyncCallback<Void> callback);
	
	public void getPrice(int offset, int limit, List<WhereBean> wheres, AsyncCallback<ParentPagingLoadResult<PriceBean>> callback);
	
	public void addPrice(PriceBean bean, AsyncCallback<Void> callback);
	
	public void updateClient(ClientBean bean, AsyncCallback<Void> callback);
	
	public void updateMaster(MasterBean bean, AsyncCallback<Void> callback);
	
	public void addUsedMaterial(IncomeMaterialsBean bean, AsyncCallback<IncomeMaterialsBean> callback);
	
	public void addProcedure(ProcedureBean bean, AsyncCallback<ProcedureBean> callback);
	
	public void loadProcedures(int offset, int limit, AsyncCallback<ParentPagingLoadResult<ProcedureBean>> callback);
	
	public void getWorkDays(int year, int month, AsyncCallback<List<WorkDayBean>> callback);
	
	public void addWorkDay(int masterId, int day, int month, int year, AsyncCallback<Void> callback);
	
	public void deleteWorkDay(int masterId, int day, int month, int year, AsyncCallback<Void> callback);
	
	public void updateMaterial(MaterialBean bean, AsyncCallback<Void> callback);

	public void getProceduresForDay(Date date, int offset, AsyncCallback<Map<Date, Map<MasterBean, ProcedureBean>>> callback);
	
	public void loadCurrentMaterials(int offset, int limit, List<WhereBean> wheres, AsyncCallback<ParentPagingLoadResult<IncomeMaterialsBean>> callback);
	
	public void calcCurrentMaterial(AsyncCallback<Void> callback);
	
	public void getOutcomeMaterials(int offset, int limit, List<WhereBean> wheres, AsyncCallback<ParentPagingLoadResult<IncomeMaterialsBean>> callback);
	
	public void addOutcomeMaterial(IncomeMaterialsBean bean, AsyncCallback<Void> callback);
	
	public void updateProcedure(ProcedureBean bean, AsyncCallback<Void> callback);
}
